<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<script type="text/javascript">
			window.onload = function() {
				var blue = document.getElementsByTagName('li')[1];
				console.log(blue);
				console.log(blue.parentNode);
				console.log(blue.parentNode.parentNode);
				console.log(blue.parentNode.parentNode.parentNode);
				console.log(blue.parentNode.parentNode.parentNode.parentNode);
				console.log(blue.parentNode.parentNode.parentNode.parentNode.parentNode);
			}
		</script>
	</head>
	<body>
		<ul>
			<li>red</li>
			<li>blue</li>
			<li>green</li>
		</ul>
	</body>
</html>
